package com.example.mdc.logback.module.controller;

import com.example.mdc.logback.module.service.HelloService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:      liu_pc
 * Date:        2023/8/7
 * Description: HelloController
 * Version: 1.0
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    private final HelloService helloService;

    private HelloController(HelloService helloService) {
        this.helloService = helloService;
    }

    /**
     * 测试MDC异步任务全局链路
     * @param param 请求参数
     * @return new String Info
     */
    @GetMapping("test")
    public String helloAsync(@RequestParam String param) {
        return helloService.test(param);
    }
}
